import request from '../assets/js/request'


// 拿到分类的信息并跳转任务添加页面
export function toTask() {
    request({
        url: '/task/toTask',
        method: 'get'
    }).then(response => {
        window.location.href = '/postad'
    }).catch(error => {
    })

}

export function productDetail() {
    request({
        url: '/task/taskDetails',
        method: 'get'
    })
}

export function login(data) {
    return request({
        url: '/sso/login',
        method: 'post',
        data: data
    })
}

export function getInfo(params) {
    return request({
        url: '/sso/info',
        method: 'get',
        data: params
    })
}

export function logout() {
    return request({
        url: '/sso/logout',
        method: 'post',
    })
}

export function generateAuthCode(telephone) {
    return request({
        url: '/sso/getAuthCode',
        method: 'get',
        params: {telephone: telephone}
    })
}

export function register(data) {
    return request({
        url: '/sso/register',
        method: 'post',
        data: data
    })
}

export function update(id, data) {
    return request({
        url: '/sso/update/' + id,
        method: 'post',
        data: data
    })
}

export function verifyUsername(username) {
    return request({
        url: '/sso/verifyUsername',
        method: 'get',
        params: {username: username}
    })
}

export function verifyTelephone(telephone) {
    return request({
        url: '/sso/verifyTelephone',
        method: 'get',
        params: {telephone: telephone}
    })
}

export function productHome() {
    return request({
        url: '/home',
        method: 'get'
    })
}

export function taskAccordion() {
    return request({
        url: '/task/accordion',
        method: 'get'
    })
}




